<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <button>按钮</button>
    <script>
    const btn = document.querySelector('button'); 
    btn.addEventListener('click', () => { let myDate; 
        console.log(new Date()); for (let i = 0; i < 10000000; i++) { let date = new Date(); myDate = date; }console.log(new Date()); 
        let pElem = document.createElement('p'); 
        pElem.textContent = '新增段落'; 
        document.body.appendChild(pElem); });
    </script>
</body>
</html>